The example code is taken from the SWIG documentation:
http://www.swig.org/Doc3.0/SWIGDocumentation.html#Introduction_nn4